<%-- 
    Document   : manager
    Created on : Sep 24, 2013, 11:22:24 AM
    Author     : Lambach
--%>
<%@page import="com.apt.bean.User"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="showuser" uri="/WEB-INF/tlds/tag_showalluser.tld"  %>
<%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib  prefix="sendemail" uri="/WEB-INF/tlds/send_email.tld" %>
<%@taglib  prefix="showAccdisable" uri="/WEB-INF/tlds/disable_tag.tld" %>
<%@taglib prefix="fb" uri="/WEB-INF/tlds/freedtag_library.tld" %>
<%@taglib  prefix="adv" uri="/WEB-INF/tlds/advertisements_tag_library.tld" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Admin Home Page</title>
        <link rel="stylesheet" href="resources/css/reset.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="resources/css/style.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="resources/css/invalid.css" type="text/css" media="screen" />
        <script type="text/javascript" src="resources/scripts/jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="resources/scripts/simpla.jquery.configuration.js"></script>
        <script type="text/javascript" src="resources/scripts/facebox.js"></script>
        <script type="text/javascript" src="resources/scripts/jquery.wysiwyg.js"></script>
        <script type="text/javascript" src="resources/scripts/jquery.datePicker.js"></script>
        <script type="text/javascript" src="resources/scripts/jquery.date.js"></script>

    </head>
    <body><div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
            <!--kiemtra quyen truy cap de dieu huong o day-->
            <c:set var="log"  value='<%=session.getAttribute("adminUser")%>'/>
            <%
                User ad = (User) session.getAttribute("adminUser");
                int adId = 0;
                if (ad != null) {
                    adId = ad.getAccount_Id();
                } else {
                    try {
                        adId = Integer.parseInt(request.getParameter("id"));
                    } catch (NumberFormatException e) {
                    }
                }

            %>
            <c:set var="adminID" value='<%=adId%>'/>
            <c:set var="select" value='<%=request.getAttribute("option")%>'/>
            <c:choose>
                <c:when test="${log!=null}">
                    <%
                        User u = (User) session.getAttribute("adminUser");
                        String adminName = u.getUser_Name();
                        session.setAttribute("Account", u);
                    %>
                    <c:set var="option" value='<%=request.getParameter("menu")%>'/>
                    <div id="sidebar"><div id="sidebar-wrapper"> <!-- Sidebar with logo and menu -->

                            <h1 id="sidebar-title"><a href="#">Admin Home Page </a></h1>

                            <!-- Logo (221px wide) -->
                            <div align="center"> <a href="#"><img id="logo" src="resources/images/logo_admin.gif" alt="Admin Home Page" /></a> </div>

                            <!-- Sidebar Profile links -->
                            <div id="profile-links">

                                Hello, <a href="#" title="Edit your profile"><c:out value="<%=adminName%>"/></a>, you have <a href="#messages" rel="modal" title="3 Messages">3 Messages</a><br />
                                <br />
                                <a href="index.jsp" title="View the Site" >View the Site</a> | <a href="authenticate.jsp" title="Sign Out"  >Sign Out</a>
                            </div>

                            <ul id="main-nav">  <!-- Accordion Menu -->

                                <li>
                                    <a href="#" class="nav-top-item "> <!-- class="nav-top-item current"Add the class "current" to current menu item -->
                                        Member Manager
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=1&id=${adminID}"> All Member </a></li> <!-- class="current"Add class "current" to sub menu items also -->  
                                        <li><a href="Navigation?menu=8&id=${adminID}">Manage Account Disable </a></li>
                                        <li><a href="Navigation?menu=2&id=${adminID}">Manage Account Expired</a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Feedback 
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=9&id=${adminID}" >List Feedback</a></li>
                                    </ul>
                                </li>

                                <li>
                                    <a href="#" class="nav-top-item">
                                        Advertisement
                                    </a>
                                    <ul>
                                        <li><a href="advertisements.jsp?menu=3&id=${adminID}" >List Advertisement</a></li>
                                        <li><a href="advertisements.jsp?menu=4&id=${adminID}">Advertisement Enable </a></li>
                                        <li><a href="advertisements.jsp?menu=5&id=${adminID}">Advertisement Disable</a></li>

                                    </ul>
                                </li>

                                <li>
                                    <a href="#" class="nav-top-item">
                                        Settings
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=6&id=${adminID}">Create New Admin Account</a></li>
                                        <li><a href="Navigation?menu=7&id=${adminID}">Update Admin Account </a></li>

                                    </ul>
                                </li>

                                <li>
                                    <a href="#" class="nav-top-item">
                                        Countries
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=12&id=${adminID}" >Manager Countries</a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Caste
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=13&id=${adminID}" >Manager Caste</a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Professional
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=14&id=${adminID}" >Manager Professional </a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Religion
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=15&id=${adminID}" >Manager Religion </a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Preferences
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=16&id=${adminID}" >Manager Preferences </a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Payments
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=17&id=${adminID}" >Manager Payments </a></li>
                                    </ul>
                                </li>
                            </ul> <!-- End #main-nav -->

                        </div></div> <!-- End #sidebar -->

                    <div id="main-content"> <!-- Main Content Section with everything -->

                        <noscript> <!-- Show a notification if the user has disabled javascript -->
                            <div class="notification error png_bg">
                                <div>
                                    Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly.
                                </div>
                            </div>
                        </noscript>

                        <!-- Page Head -->
                        <h2>Welcome <%=adminName%></h2>
                        <p id="page-intro">What would you like to do?</p>

                        <ul class="shortcut-buttons-set">

                            <li><a class="shortcut-button" href="#"><span>
                                        <img src="resources/images/icons/pencil_48.png" alt="icon" /><br />
                                        Write an Article
                                    </span></a></li>

                            <li><a class="shortcut-button" href="#"><span>
                                        <img src="resources/images/icons/paper_content_pencil_48.png" alt="icon" /><br />
                                        Create a New Page
                                    </span></a></li>

                            <li><a class="shortcut-button" href="#"><span>
                                        <img src="resources/images/icons/image_add_48.png" alt="icon" /><br />
                                        Upload an Image
                                    </span></a></li>

                            <li><a class="shortcut-button" href="#"><span>
                                        <img src="resources/images/icons/clock_48.png" alt="icon" /><br />
                                        Add an Event
                                    </span></a></li>

                            <li><a class="shortcut-button" href="#messages" rel="modal"><span>
                                        <img src="resources/images/icons/comment_48.png" alt="icon" /><br />
                                        Open Modal
                                    </span></a></li>

                        </ul><!-- End .shortcut-buttons-set -->
                        <div class="clear"></div> 
                        <div>  <html:form action="/managersearch" >
                                <table border="1">
                                    <thead>
                                        <tr>
                                            <th>Search by Company_Issued</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <tbody>
                                        <tr>
                                            <td><html:text property="byname"/></td>
                                            <td><html:submit value="Search"/> </td>
                                        </tr>
                                    </tbody>
                                    </tbody>
                                </table>

                            </html:form></div>
                        <div class="clear"></div> <!-- End .clear -->

                        <div class="content-box"><!-- Start Content Box -->

                            <div class="content-box-header">

                                <h3 id="contenttitle" ></h3>

                                <div class="clear"></div>

                            </div> <!-- End .content-box-header -->

                            <c:if test="${option==3||option==4||option==5}">
                                <div class="content-box-content">

                                    <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
                                      
                                        <table id="table_us" >
                                            <thead>
                                                <tr>
                                                    <!--<th><input class="check-all" type="checkbox" /></th>-->
                                                    <th id="datems">Company_Issued</th>
                                                    <th id="datems">Images </th>
                                                    <th id="of1">Date Register</th>
                                                    <th id="of2">Date Expired </th>
                                                    <th id="of4">Current Status  </th>
                                                    <th id="of3">Setting </th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <c:choose>
                                                    <c:when test="${option==3}">
                                                        <c:set var="page" value='<%=request.getParameter("pageno")%>'/>
                                                        <adv:Advertisement_TagHandler page="${page}"/>
                                                        <script type="text/javascript">
                                                            var ms = document.getElementById("contenttitle");
                                                            ms.innerHTML = "All Advertisement";
                                                        </script>
                                                </c:when>
                                                <c:when test="${option==4}">
                                                    <c:set var="page" value='<%=request.getParameter("pageno")%>'/>
                                                   
                                                </c:when>
                                                <c:when test="${option==4}">
                                                    <c:set var="page" value='<%=request.getParameter("pageno")%>'/>
                                                   
                                                </c:when>
                                            </c:choose>
                                            </tbody>
                                        </table>


                                    </div> <!-- End #tab1 -->
                                </div> <!-- End .content-box-content -->
                            </c:if>

                        </div> <!-- End .content-box -->

                        <div class="clear"></div>


                        <div id="footer">
                            <small> <!-- Remove this notice or replace it with whatever you want -->
                                &#169; Copyright 2009 Your Company | Powered by <a href="http://themeforest.net/item/simpla-admin-flexible-user-friendly-admin-skin/46073">Simpla Admin</a> | <a href="#">Top</a>
                            </small>
                        </div><!-- End #footer -->

                    </div> <!-- End #main-content -->

                </div>
            </c:when>

            <c:otherwise ><c:out value="<h1>User Invalidate !</h1>"/>
                <h1 style=" font-size: larger;color: #ffffff"><c:out value="${log2}"/></h1>  </c:otherwise>
        </c:choose>
    </body>
</html>
